import {baseUrl} from '../api/api'

const requestApi = (param) => {
    return new Promise((resolve, reject) => {
        swan.request({
            url: baseUrl.urlApi,
            header: {
                'content-type': 'application/json'
            },
            method: 'GET',
            dataType: 'json',
            responseType: 'text',
            data:param,
            success: res => {
                resolve(res);
            },
            fail: err => {
                console.log('错误码：' + err.errCode);
                console.log('错误信息：' + err.errMsg);
            }
        });
    });
}

export {requestApi}

